package com.eunion;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.annotation.EnableScheduling;

import com.eunion.boot.ConfigServletContextListener;
import com.eunion.common.util.BoShiGxmd;

/**
 * 以jar形式启动程序.
 * 
 * 
 * @version 2015年7月22日
 */
@SpringBootApplication
@EnableScheduling
public class AppStart implements CommandLineRunner {

    private static Logger LOGGER = LoggerFactory.getLogger(AppStart.class);

    /**
     * APP启动入口.
     */
    public static void main(String[] args) {
        // System.setProperty("spring.devtools.restart.enabled", "false");
        ApplicationContext ctx = SpringApplication.run(new Class[] {AppStart.class, ConfigServletContextListener.class}, args);
        LOGGER.info("Let's inspect the beans provided by Spring Boot:" + ctx);
        String[] beanNames = ctx.getBeanDefinitionNames();
        LOGGER.info("所有beanNames个数：" + beanNames.length);
        //		for (String bn : beanNames) {
        //			LOGGER.info("bean name:{}" + bn);
        //		}
    }

    @Override
    public void run(String... strings)
            throws Exception {
    }

}
